﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ui="clr-namespace:PokemonBattleOnline.PBO.Elements"
                    xmlns:c="clr-namespace:PokemonBattleOnline.PBO.Converters">
    <ItemsPanelTemplate x:Key="WrapPanelTemplate">
        <WrapPanel Background="{x:Null}" Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"/>
    </ItemsPanelTemplate>
    <ItemsPanelTemplate x:Key="VerticalWrapPanelTemplate">
        <WrapPanel Background="{x:Null}" Orientation="Vertical" Height="{Binding (FrameworkElement.ActualHeight), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"/>
    </ItemsPanelTemplate>
    <Style x:Key="XButton" TargetType="Button">
        <Setter Property="Content" Value="×"/>
        <Setter Property="Background" Value="Red"/>
        <Setter Property="BorderBrush" Value="DarkRed"/>
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <TextBlock Name="x" Text="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="x" Property="Foreground" Value="{Binding Background,RelativeSource={RelativeSource TemplatedParent}}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="x" Property="Foreground" Value="{Binding BorderBrush,RelativeSource={RelativeSource TemplatedParent}}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="x" Property="Opacity" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="STextBlock" TargetType="Label">
        <Setter Property="FontFamily" Value="SimSun"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="Background" Value="Black"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Label">
                    <Grid DataContext="{TemplateBinding Content,Converter={x:Static c:AllString.C}}" ClipToBounds="False" IsHitTestVisible="False" SnapsToDevicePixels="True">
                        <TextBlock Margin="-1,0,0,0" Foreground="{TemplateBinding Background}"  Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Margin="-1,-1,0,0" Foreground="{TemplateBinding Background}" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Margin="0,-1,0,0" Foreground="{TemplateBinding Background}" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Margin="1,-1,0,0" Foreground="{TemplateBinding Background}" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Margin="1,0,0,0" Foreground="{TemplateBinding Background}" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Margin="1,1,0,0" Foreground="{TemplateBinding Background}" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Margin="0,1,0,0" Foreground="{TemplateBinding Background}" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Margin="-1,1,0,0" Foreground="{TemplateBinding Background}" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                        <TextBlock Foreground="White" Text="{Binding}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>